
<?php
  /*
    Copyright 2010 Persistent Systems Limited

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
   */

    /**
    * This code was generated by the tool 'PHPDataSvcUtil.php'.
    * Runtime Version:1.0
    *
    * Changes to this file may cause incorrect behavior and will be lost if
    * the code is regenerated.
    */

    require_once 'Context/ObjectContext.php';
    /**
    * Defines default OData Service URL for this proxy class
    */
    define("DEFAULT_ODATA_SERVICE_URL", "http://localhost:13985/VideoGameStoreDataService.svc");
    
   /**
    * @class:Accessory
    * @type:EntityType
    * @key:ProductID
    */
    class Accessory extends Object
    {
        protected $_entityMap = array();
        protected $_entityKey = array();
        protected $_relLinks  = array();
        protected $_baseURI;

    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.Int32
        */
        public $ProductID;
    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.String
        * @MaxLength:100
        * @FixedLength:false
        */
        public $SystemName;
    
       /**
        * @Type:NavigationProperty
        * @Relationship:FK_Accessory_Product
        * @FromRole:Accessory
        * @ToRole:Product
        */
        public $Product;
    

       /**
        * Function to create an instance of Accessory
        * @param Edm.Int32 $ProductID
        * @param Edm.String $SystemName
        */
        public static function CreateAccessory(
            $ProductID, 
            $SystemName)
        {   
            $Accessory = new Accessory();
            $Accessory->ProductID = $ProductID;
            $Accessory->SystemName = $SystemName;
            return $Accessory;
        }

       /**
        * Constructor for Accessory
        */
        public function __construct($uri = "")
        {
            $this->_objectID = Guid::NewGuid();
            $this->_baseURI = $uri;
    
            $this->_entityMap['Product'] = 'Product';
            $this->_entityKey[] = 'ProductID';
            $this->Product = array();
        }

       /**
        * overring getObjectID() functon of Object class
        */
        public function getObjectID()
        {
            return $this->_objectID;
        }

       /**
        * This function returns the entity keys of this entity.
        */
        public function getEntityKeys()
        {
            return $this->_entityKey;
        }

       /**
        * This function set the entity keys of this entity.
        */
        public function setEntityKeys($entityKey)
        {
            $this->_entityKey = $entityKey;
        }

       /**
        * This function returns the related links of this entity.
        */
        public function getRelatedLinks()
        {
            return $this->_relLinks;
        }

       /**
        * This function set the related links of this entity.
        */
        public function setRelatedLinks($relLinks)
        {
            $this->_relLinks = $relLinks;
        }

       /**
        * Function for getting Entity Type Name corrosponding to navigation Name
        */
        public function getActualEntityTypeName($key)
        {
            if (array_key_exists($key, $this->_entityMap))
            {
                return ($this->_entityMap[$key]);
            }
            return $key;
        }
    }
  
   /**
    * @class:Console
    * @type:EntityType
    * @key:ProductID
    */
    class Console extends Object
    {
        protected $_entityMap = array();
        protected $_entityKey = array();
        protected $_relLinks  = array();
        protected $_baseURI;

    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.Int32
        */
        public $ProductID;
    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.String
        * @MaxLength:50
        * @FixedLength:false
        */
        public $DriveType;
    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.Double
        */
        public $DriveSize;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:Max
        * @FixedLength:false
        */
        public $ConsoleDetails;
    
       /**
        * @Type:NavigationProperty
        * @Relationship:FK_Console_Product
        * @FromRole:Console
        * @ToRole:Product
        */
        public $Product;
    

       /**
        * Function to create an instance of Console
        * @param Edm.Int32 $ProductID
        * @param Edm.String $DriveType
        * @param Edm.Double $DriveSize
        */
        public static function CreateConsole(
            $ProductID, 
            $DriveType, 
            $DriveSize)
        {   
            $Console = new Console();
            $Console->ProductID = $ProductID;
            $Console->DriveType = $DriveType;
            $Console->DriveSize = $DriveSize;
            return $Console;
        }

       /**
        * Constructor for Console
        */
        public function __construct($uri = "")
        {
            $this->_objectID = Guid::NewGuid();
            $this->_baseURI = $uri;
    
            $this->_entityMap['Product'] = 'Product';
            $this->_entityKey[] = 'ProductID';
            $this->Product = array();
        }

       /**
        * overring getObjectID() functon of Object class
        */
        public function getObjectID()
        {
            return $this->_objectID;
        }

       /**
        * This function returns the entity keys of this entity.
        */
        public function getEntityKeys()
        {
            return $this->_entityKey;
        }

       /**
        * This function set the entity keys of this entity.
        */
        public function setEntityKeys($entityKey)
        {
            $this->_entityKey = $entityKey;
        }

       /**
        * This function returns the related links of this entity.
        */
        public function getRelatedLinks()
        {
            return $this->_relLinks;
        }

       /**
        * This function set the related links of this entity.
        */
        public function setRelatedLinks($relLinks)
        {
            $this->_relLinks = $relLinks;
        }

       /**
        * Function for getting Entity Type Name corrosponding to navigation Name
        */
        public function getActualEntityTypeName($key)
        {
            if (array_key_exists($key, $this->_entityMap))
            {
                return ($this->_entityMap[$key]);
            }
            return $key;
        }
    }
  
   /**
    * @class:Customer
    * @type:EntityType
    * @key:CustomerID
    */
    class Customer extends Object
    {
        protected $_entityMap = array();
        protected $_entityKey = array();
        protected $_relLinks  = array();
        protected $_baseURI;

    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.Int32
        */
        public $CustomerID;
    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.String
        * @MaxLength:50
        * @FixedLength:false
        */
        public $CustomerName;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:50
        * @FixedLength:false
        */
        public $CustomerAddress;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:Max
        * @FixedLength:false
        */
        public $CustomerDetails;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.Guid
        */
        public $CustomerMembershipId;
    
       /**
        * @Type:NavigationProperty
        * @Relationship:FK_Purchase_Customer
        * @FromRole:Customer
        * @ToRole:Purchase
        */
        public $Purchase;
    

       /**
        * Function to create an instance of Customer
        * @param Edm.Int32 $CustomerID
        * @param Edm.String $CustomerName
        */
        public static function CreateCustomer(
            $CustomerID, 
            $CustomerName)
        {   
            $Customer = new Customer();
            $Customer->CustomerID = $CustomerID;
            $Customer->CustomerName = $CustomerName;
            return $Customer;
        }

       /**
        * Constructor for Customer
        */
        public function __construct($uri = "")
        {
            $this->_objectID = Guid::NewGuid();
            $this->_baseURI = $uri;
    
            $this->_entityMap['Purchase'] = 'Purchase';
            $this->_entityKey[] = 'CustomerID';
            $this->Purchase = array();
        }

       /**
        * overring getObjectID() functon of Object class
        */
        public function getObjectID()
        {
            return $this->_objectID;
        }

       /**
        * This function returns the entity keys of this entity.
        */
        public function getEntityKeys()
        {
            return $this->_entityKey;
        }

       /**
        * This function set the entity keys of this entity.
        */
        public function setEntityKeys($entityKey)
        {
            $this->_entityKey = $entityKey;
        }

       /**
        * This function returns the related links of this entity.
        */
        public function getRelatedLinks()
        {
            return $this->_relLinks;
        }

       /**
        * This function set the related links of this entity.
        */
        public function setRelatedLinks($relLinks)
        {
            $this->_relLinks = $relLinks;
        }

       /**
        * Function for getting Entity Type Name corrosponding to navigation Name
        */
        public function getActualEntityTypeName($key)
        {
            if (array_key_exists($key, $this->_entityMap))
            {
                return ($this->_entityMap[$key]);
            }
            return $key;
        }
    }
  
   /**
    * @class:Game
    * @type:EntityType
    * @key:ProductID
    */
    class Game extends Object
    {
        protected $_entityMap = array();
        protected $_entityKey = array();
        protected $_relLinks  = array();
        protected $_baseURI;

    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.Int32
        */
        public $ProductID;
    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.String
        * @MaxLength:100
        * @FixedLength:false
        */
        public $SystemName;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:100
        * @FixedLength:false
        */
        public $Rating;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:100
        * @FixedLength:false
        */
        public $Genre;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:100
        * @FixedLength:false
        */
        public $Publisher;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:100
        * @FixedLength:false
        */
        public $Developer;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:250
        * @FixedLength:false
        */
        public $RatingUrl;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:100
        * @FixedLength:false
        */
        public $PlayerInfo;
    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.Binary
        */
        public $GameVersion;
    
       /**
        * @Type:NavigationProperty
        * @Relationship:FK_Game_Product
        * @FromRole:Game
        * @ToRole:Product
        */
        public $Product;
    

       /**
        * Function to create an instance of Game
        * @param Edm.Int32 $ProductID
        * @param Edm.String $SystemName
        * @param Edm.Binary $GameVersion
        */
        public static function CreateGame(
            $ProductID, 
            $SystemName, 
            $GameVersion)
        {   
            $Game = new Game();
            $Game->ProductID = $ProductID;
            $Game->SystemName = $SystemName;
            $Game->GameVersion = $GameVersion;
            return $Game;
        }

       /**
        * Constructor for Game
        */
        public function __construct($uri = "")
        {
            $this->_objectID = Guid::NewGuid();
            $this->_baseURI = $uri;
    
            $this->_entityMap['Product'] = 'Product';
            $this->_entityKey[] = 'ProductID';
            $this->Product = array();
        }

       /**
        * overring getObjectID() functon of Object class
        */
        public function getObjectID()
        {
            return $this->_objectID;
        }

       /**
        * This function returns the entity keys of this entity.
        */
        public function getEntityKeys()
        {
            return $this->_entityKey;
        }

       /**
        * This function set the entity keys of this entity.
        */
        public function setEntityKeys($entityKey)
        {
            $this->_entityKey = $entityKey;
        }

       /**
        * This function returns the related links of this entity.
        */
        public function getRelatedLinks()
        {
            return $this->_relLinks;
        }

       /**
        * This function set the related links of this entity.
        */
        public function setRelatedLinks($relLinks)
        {
            $this->_relLinks = $relLinks;
        }

       /**
        * Function for getting Entity Type Name corrosponding to navigation Name
        */
        public function getActualEntityTypeName($key)
        {
            if (array_key_exists($key, $this->_entityMap))
            {
                return ($this->_entityMap[$key]);
            }
            return $key;
        }
    }
  
   /**
    * @class:Product
    * @type:EntityType
    * @key:ProductID
    */
    class Product extends Object
    {
        protected $_entityMap = array();
        protected $_entityKey = array();
        protected $_relLinks  = array();
        protected $_baseURI;

    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.Int32
        */
        public $ProductID;
    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.String
        * @MaxLength:100
        * @FixedLength:false
        */
        public $ProductName;
    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.String
        * @MaxLength:1000
        * @FixedLength:false
        */
        public $ProductDescription;
    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.Double
        */
        public $ListPrice;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.DateTime
        */
        public $ReleaseDate;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:250
        * @FixedLength:false
        */
        public $ProductImageUrl;
    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.String
        * @MaxLength:10
        * @FixedLength:false
        */
        public $ListPriceCurrency;
    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.Binary
        */
        public $ProductVersion;
    
       /**
        * @Type:NavigationProperty
        * @Relationship:FK_Accessory_Product
        * @FromRole:Product
        * @ToRole:Accessory
        */
        public $Accessory;
    
       /**
        * @Type:NavigationProperty
        * @Relationship:FK_Console_Product
        * @FromRole:Product
        * @ToRole:Console
        */
        public $Console;
    
       /**
        * @Type:NavigationProperty
        * @Relationship:FK_Game_Product
        * @FromRole:Product
        * @ToRole:Game
        */
        public $Game;
    
       /**
        * @Type:NavigationProperty
        * @Relationship:FK_Product_ProductType
        * @FromRole:Product
        * @ToRole:ProductType
        */
        public $ProductType;
    
       /**
        * @Type:NavigationProperty
        * @Relationship:FK_Product_Supplier
        * @FromRole:Product
        * @ToRole:Supplier
        */
        public $Supplier;
    
       /**
        * @Type:NavigationProperty
        * @Relationship:FK_PurchaseItem_Product
        * @FromRole:Product
        * @ToRole:PurchaseItem
        */
        public $PurchaseItem;
    

       /**
        * Function to create an instance of Product
        * @param Edm.Int32 $ProductID
        * @param Edm.String $ProductName
        * @param Edm.String $ProductDescription
        * @param Edm.Double $ListPrice
        * @param Edm.String $ListPriceCurrency
        * @param Edm.Binary $ProductVersion
        */
        public static function CreateProduct(
            $ProductID, 
            $ProductName, 
            $ProductDescription, 
            $ListPrice, 
            $ListPriceCurrency, 
            $ProductVersion)
        {   
            $Product = new Product();
            $Product->ProductID = $ProductID;
            $Product->ProductName = $ProductName;
            $Product->ProductDescription = $ProductDescription;
            $Product->ListPrice = $ListPrice;
            $Product->ListPriceCurrency = $ListPriceCurrency;
            $Product->ProductVersion = $ProductVersion;
            return $Product;
        }

       /**
        * Constructor for Product
        */
        public function __construct($uri = "")
        {
            $this->_objectID = Guid::NewGuid();
            $this->_baseURI = $uri;
    
            $this->_entityMap['Accessory'] = 'Accessory';
            $this->_entityMap['Console'] = 'Console';
            $this->_entityMap['Game'] = 'Game';
            $this->_entityMap['ProductType'] = 'ProductType';
            $this->_entityMap['Supplier'] = 'Supplier';
            $this->_entityMap['PurchaseItem'] = 'PurchaseItem';
            $this->_entityKey[] = 'ProductID';
            $this->Accessory = array();
            $this->Console = array();
            $this->Game = array();
            $this->ProductType = array();
            $this->Supplier = array();
            $this->PurchaseItem = array();
        }

       /**
        * overring getObjectID() functon of Object class
        */
        public function getObjectID()
        {
            return $this->_objectID;
        }

       /**
        * This function returns the entity keys of this entity.
        */
        public function getEntityKeys()
        {
            return $this->_entityKey;
        }

       /**
        * This function set the entity keys of this entity.
        */
        public function setEntityKeys($entityKey)
        {
            $this->_entityKey = $entityKey;
        }

       /**
        * This function returns the related links of this entity.
        */
        public function getRelatedLinks()
        {
            return $this->_relLinks;
        }

       /**
        * This function set the related links of this entity.
        */
        public function setRelatedLinks($relLinks)
        {
            $this->_relLinks = $relLinks;
        }

       /**
        * Function for getting Entity Type Name corrosponding to navigation Name
        */
        public function getActualEntityTypeName($key)
        {
            if (array_key_exists($key, $this->_entityMap))
            {
                return ($this->_entityMap[$key]);
            }
            return $key;
        }
    }
  
   /**
    * @class:ProductType
    * @type:EntityType
    * @key:ProductTypeID
    */
    class ProductType extends Object
    {
        protected $_entityMap = array();
        protected $_entityKey = array();
        protected $_relLinks  = array();
        protected $_baseURI;

    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.Int32
        */
        public $ProductTypeID;
    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.String
        * @MaxLength:50
        * @FixedLength:false
        */
        public $ProductTypeName;
    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.String
        * @MaxLength:250
        * @FixedLength:false
        */
        public $ProductTypeDescription;
    
       /**
        * @Type:NavigationProperty
        * @Relationship:FK_Product_ProductType
        * @FromRole:ProductType
        * @ToRole:Product
        */
        public $Product;
    

       /**
        * Function to create an instance of ProductType
        * @param Edm.Int32 $ProductTypeID
        * @param Edm.String $ProductTypeName
        * @param Edm.String $ProductTypeDescription
        */
        public static function CreateProductType(
            $ProductTypeID, 
            $ProductTypeName, 
            $ProductTypeDescription)
        {   
            $ProductType = new ProductType();
            $ProductType->ProductTypeID = $ProductTypeID;
            $ProductType->ProductTypeName = $ProductTypeName;
            $ProductType->ProductTypeDescription = $ProductTypeDescription;
            return $ProductType;
        }

       /**
        * Constructor for ProductType
        */
        public function __construct($uri = "")
        {
            $this->_objectID = Guid::NewGuid();
            $this->_baseURI = $uri;
    
            $this->_entityMap['Product'] = 'Product';
            $this->_entityKey[] = 'ProductTypeID';
            $this->Product = array();
        }

       /**
        * overring getObjectID() functon of Object class
        */
        public function getObjectID()
        {
            return $this->_objectID;
        }

       /**
        * This function returns the entity keys of this entity.
        */
        public function getEntityKeys()
        {
            return $this->_entityKey;
        }

       /**
        * This function set the entity keys of this entity.
        */
        public function setEntityKeys($entityKey)
        {
            $this->_entityKey = $entityKey;
        }

       /**
        * This function returns the related links of this entity.
        */
        public function getRelatedLinks()
        {
            return $this->_relLinks;
        }

       /**
        * This function set the related links of this entity.
        */
        public function setRelatedLinks($relLinks)
        {
            $this->_relLinks = $relLinks;
        }

       /**
        * Function for getting Entity Type Name corrosponding to navigation Name
        */
        public function getActualEntityTypeName($key)
        {
            if (array_key_exists($key, $this->_entityMap))
            {
                return ($this->_entityMap[$key]);
            }
            return $key;
        }
    }
  
   /**
    * @class:Purchase
    * @type:EntityType
    * @key:PurchaseID
    */
    class Purchase extends Object
    {
        protected $_entityMap = array();
        protected $_entityKey = array();
        protected $_relLinks  = array();
        protected $_baseURI;

    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.Int32
        */
        public $PurchaseID;
    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.DateTime
        */
        public $PurchaseDate;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:Max
        * @FixedLength:false
        */
        public $Details;
    
       /**
        * @Type:NavigationProperty
        * @Relationship:FK_Purchase_Customer
        * @FromRole:Purchase
        * @ToRole:Customer
        */
        public $Customer;
    
       /**
        * @Type:NavigationProperty
        * @Relationship:FK_PurchaseItem_Purchase
        * @FromRole:Purchase
        * @ToRole:PurchaseItem
        */
        public $PurchaseItem;
    

       /**
        * Function to create an instance of Purchase
        * @param Edm.Int32 $PurchaseID
        * @param Edm.DateTime $PurchaseDate
        */
        public static function CreatePurchase(
            $PurchaseID, 
            $PurchaseDate)
        {   
            $Purchase = new Purchase();
            $Purchase->PurchaseID = $PurchaseID;
            $Purchase->PurchaseDate = $PurchaseDate;
            return $Purchase;
        }

       /**
        * Constructor for Purchase
        */
        public function __construct($uri = "")
        {
            $this->_objectID = Guid::NewGuid();
            $this->_baseURI = $uri;
    
            $this->_entityMap['Customer'] = 'Customer';
            $this->_entityMap['PurchaseItem'] = 'PurchaseItem';
            $this->_entityKey[] = 'PurchaseID';
            $this->Customer = array();
            $this->PurchaseItem = array();
        }

       /**
        * overring getObjectID() functon of Object class
        */
        public function getObjectID()
        {
            return $this->_objectID;
        }

       /**
        * This function returns the entity keys of this entity.
        */
        public function getEntityKeys()
        {
            return $this->_entityKey;
        }

       /**
        * This function set the entity keys of this entity.
        */
        public function setEntityKeys($entityKey)
        {
            $this->_entityKey = $entityKey;
        }

       /**
        * This function returns the related links of this entity.
        */
        public function getRelatedLinks()
        {
            return $this->_relLinks;
        }

       /**
        * This function set the related links of this entity.
        */
        public function setRelatedLinks($relLinks)
        {
            $this->_relLinks = $relLinks;
        }

       /**
        * Function for getting Entity Type Name corrosponding to navigation Name
        */
        public function getActualEntityTypeName($key)
        {
            if (array_key_exists($key, $this->_entityMap))
            {
                return ($this->_entityMap[$key]);
            }
            return $key;
        }
    }
  
   /**
    * @class:PurchaseItem
    * @type:EntityType
    * @key:PurchaseItemID
    */
    class PurchaseItem extends Object
    {
        protected $_entityMap = array();
        protected $_entityKey = array();
        protected $_relLinks  = array();
        protected $_baseURI;

    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.Int32
        */
        public $PurchaseItemID;
    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.Decimal
        */
        public $Price;
    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.Int32
        */
        public $Quantity;
    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.Double
        */
        public $Discount;
    
       /**
        * @Type:NavigationProperty
        * @Relationship:FK_PurchaseItem_Product
        * @FromRole:PurchaseItem
        * @ToRole:Product
        */
        public $Product;
    
       /**
        * @Type:NavigationProperty
        * @Relationship:FK_PurchaseItem_Purchase
        * @FromRole:PurchaseItem
        * @ToRole:Purchase
        */
        public $Purchase;
    

       /**
        * Function to create an instance of PurchaseItem
        * @param Edm.Int32 $PurchaseItemID
        * @param Edm.Decimal $Price
        * @param Edm.Int32 $Quantity
        * @param Edm.Double $Discount
        */
        public static function CreatePurchaseItem(
            $PurchaseItemID, 
            $Price, 
            $Quantity, 
            $Discount)
        {   
            $PurchaseItem = new PurchaseItem();
            $PurchaseItem->PurchaseItemID = $PurchaseItemID;
            $PurchaseItem->Price = $Price;
            $PurchaseItem->Quantity = $Quantity;
            $PurchaseItem->Discount = $Discount;
            return $PurchaseItem;
        }

       /**
        * Constructor for PurchaseItem
        */
        public function __construct($uri = "")
        {
            $this->_objectID = Guid::NewGuid();
            $this->_baseURI = $uri;
    
            $this->_entityMap['Product'] = 'Product';
            $this->_entityMap['Purchase'] = 'Purchase';
            $this->_entityKey[] = 'PurchaseItemID';
            $this->Product = array();
            $this->Purchase = array();
        }

       /**
        * overring getObjectID() functon of Object class
        */
        public function getObjectID()
        {
            return $this->_objectID;
        }

       /**
        * This function returns the entity keys of this entity.
        */
        public function getEntityKeys()
        {
            return $this->_entityKey;
        }

       /**
        * This function set the entity keys of this entity.
        */
        public function setEntityKeys($entityKey)
        {
            $this->_entityKey = $entityKey;
        }

       /**
        * This function returns the related links of this entity.
        */
        public function getRelatedLinks()
        {
            return $this->_relLinks;
        }

       /**
        * This function set the related links of this entity.
        */
        public function setRelatedLinks($relLinks)
        {
            $this->_relLinks = $relLinks;
        }

       /**
        * Function for getting Entity Type Name corrosponding to navigation Name
        */
        public function getActualEntityTypeName($key)
        {
            if (array_key_exists($key, $this->_entityMap))
            {
                return ($this->_entityMap[$key]);
            }
            return $key;
        }
    }
  
   /**
    * @class:Supplier
    * @type:EntityType
    * @key:SupplierID
    */
    class Supplier extends Object
    {
        protected $_entityMap = array();
        protected $_entityKey = array();
        protected $_relLinks  = array();
        protected $_baseURI;

    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.Int32
        */
        public $SupplierID;
    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.String
        * @MaxLength:50
        * @FixedLength:false
        */
        public $SupplierName;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:250
        * @FixedLength:false
        */
        public $SupplierAddress;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.String
        * @MaxLength:50
        * @FixedLength:false
        */
        public $SupplierPhone;
    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.Binary
        */
        public $SupplierVersion;
    
       /**
        * @Type:NavigationProperty
        * @Relationship:FK_Product_Supplier
        * @FromRole:Supplier
        * @ToRole:Product
        */
        public $Product;
    

       /**
        * Function to create an instance of Supplier
        * @param Edm.Int32 $SupplierID
        * @param Edm.String $SupplierName
        * @param Edm.Binary $SupplierVersion
        */
        public static function CreateSupplier(
            $SupplierID, 
            $SupplierName, 
            $SupplierVersion)
        {   
            $Supplier = new Supplier();
            $Supplier->SupplierID = $SupplierID;
            $Supplier->SupplierName = $SupplierName;
            $Supplier->SupplierVersion = $SupplierVersion;
            return $Supplier;
        }

       /**
        * Constructor for Supplier
        */
        public function __construct($uri = "")
        {
            $this->_objectID = Guid::NewGuid();
            $this->_baseURI = $uri;
    
            $this->_entityMap['Product'] = 'Product';
            $this->_entityKey[] = 'SupplierID';
            $this->Product = array();
        }

       /**
        * overring getObjectID() functon of Object class
        */
        public function getObjectID()
        {
            return $this->_objectID;
        }

       /**
        * This function returns the entity keys of this entity.
        */
        public function getEntityKeys()
        {
            return $this->_entityKey;
        }

       /**
        * This function set the entity keys of this entity.
        */
        public function setEntityKeys($entityKey)
        {
            $this->_entityKey = $entityKey;
        }

       /**
        * This function returns the related links of this entity.
        */
        public function getRelatedLinks()
        {
            return $this->_relLinks;
        }

       /**
        * This function set the related links of this entity.
        */
        public function setRelatedLinks($relLinks)
        {
            $this->_relLinks = $relLinks;
        }

       /**
        * Function for getting Entity Type Name corrosponding to navigation Name
        */
        public function getActualEntityTypeName($key)
        {
            if (array_key_exists($key, $this->_entityMap))
            {
                return ($this->_entityMap[$key]);
            }
            return $key;
        }
    }
  
   /**
    * @class:sysdiagrams
    * @type:EntityType
    * @key:diagram_id
    */
    class sysdiagrams extends Object
    {
        protected $_entityMap = array();
        protected $_entityKey = array();
        protected $_relLinks  = array();
        protected $_baseURI;

    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.String
        * @MaxLength:128
        * @FixedLength:false
        */
        public $name;
    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.Int32
        */
        public $principal_id;
    
       /**
        * @Type:EntityProperty
        * NotNullable
        * @EdmType:Edm.Int32
        */
        public $diagram_id;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.Int32
        */
        public $version;
    
       /**
        * @Type:EntityProperty
        * @EdmType:Edm.Binary
        */
        public $definition;
    

       /**
        * Function to create an instance of sysdiagrams
        * @param Edm.String $name
        * @param Edm.Int32 $principal_id
        * @param Edm.Int32 $diagram_id
        */
        public static function Createsysdiagrams(
            $name, 
            $principal_id, 
            $diagram_id)
        {   
            $sysdiagrams = new sysdiagrams();
            $sysdiagrams->name = $name;
            $sysdiagrams->principal_id = $principal_id;
            $sysdiagrams->diagram_id = $diagram_id;
            return $sysdiagrams;
        }

       /**
        * Constructor for sysdiagrams
        */
        public function __construct($uri = "")
        {
            $this->_objectID = Guid::NewGuid();
            $this->_baseURI = $uri;
    
            $this->_entityKey[] = 'diagram_id';
        }

       /**
        * overring getObjectID() functon of Object class
        */
        public function getObjectID()
        {
            return $this->_objectID;
        }

       /**
        * This function returns the entity keys of this entity.
        */
        public function getEntityKeys()
        {
            return $this->_entityKey;
        }

       /**
        * This function set the entity keys of this entity.
        */
        public function setEntityKeys($entityKey)
        {
            $this->_entityKey = $entityKey;
        }

       /**
        * This function returns the related links of this entity.
        */
        public function getRelatedLinks()
        {
            return $this->_relLinks;
        }

       /**
        * This function set the related links of this entity.
        */
        public function setRelatedLinks($relLinks)
        {
            $this->_relLinks = $relLinks;
        }

       /**
        * Function for getting Entity Type Name corrosponding to navigation Name
        */
        public function getActualEntityTypeName($key)
        {
            if (array_key_exists($key, $this->_entityMap))
            {
                return ($this->_entityMap[$key]);
            }
            return $key;
        }
    }
  
   /**
    * Container class VideoGameStoreEntities, Namespace: VideoGameStoreModel
    */
    class VideoGameStoreEntities extends ObjectContext
    {
    
        protected $_Accessory;
        protected $_Console;
        protected $_Customer;
        protected $_Game;
        protected $_Product;
        protected $_ProductType;
        protected $_Purchase;
        protected $_PurchaseItem;
        protected $_Supplier;
        protected $_sysdiagrams;
        
       /**
        * The constructor for VideoGameStoreEntities accepting service URI
        */
        public function __construct($uri = "")
        {
            if(strlen($uri) == 0)
            {
                $uri = DEFAULT_ODATA_SERVICE_URL;
            }

            if (Utility::reverseFind($uri, '/') != strlen($uri) - 1)
            {
                $uri = $uri . '/';
            }

            $this->_baseURI = $uri;
            parent::__construct($this->_baseURI);
            $this->_entities = array(
                                "Accessory",
                                "Console",
                                "Customer",
                                "Game",
                                "Product",
                                "ProductType",
                                "Purchase",
                                "PurchaseItem",
                                "Supplier",
                                "sysdiagrams");
            $this->_entitySet2Type = array(
                                            "accessory" => "Accessory", 
                                            "console" => "Console", 
                                            "customer" => "Customer", 
                                            "game" => "Game", 
                                            "product" => "Product", 
                                            "producttype" => "ProductType", 
                                            "purchase" => "Purchase", 
                                            "purchaseitem" => "PurchaseItem", 
                                            "supplier" => "Supplier", 
                                            "sysdiagrams" => "sysdiagrams");
            $this->_entityType2Set = array(
                                            "accessory" => "Accessory", 
                                            "console" => "Console", 
                                            "customer" => "Customer", 
                                            "game" => "Game", 
                                            "product" => "Product", 
                                            "producttype" => "ProductType", 
                                            "purchase" => "Purchase", 
                                            "purchaseitem" => "PurchaseItem", 
                                            "supplier" => "Supplier", 
                                            "sysdiagrams" => "sysdiagrams");

            $this->_association = array(
                                         "FK_Accessory_Product" => array(
                                                                         "Product" => "1" ,
                                                                         "Accessory" => "0..1" ), 
                                         "FK_Console_Product" => array(
                                                                         "Product" => "1" ,
                                                                         "Console" => "0..1" ), 
                                         "FK_Purchase_Customer" => array(
                                                                         "Customer" => "1" ,
                                                                         "Purchase" => "*" ), 
                                         "FK_Game_Product" => array(
                                                                         "Product" => "1" ,
                                                                         "Game" => "0..1" ), 
                                         "FK_Product_ProductType" => array(
                                                                         "ProductType" => "1" ,
                                                                         "Product" => "*" ), 
                                         "FK_Product_Supplier" => array(
                                                                         "Supplier" => "0..1" ,
                                                                         "Product" => "*" ), 
                                         "FK_PurchaseItem_Product" => array(
                                                                         "Product" => "1" ,
                                                                         "PurchaseItem" => "*" ), 
                                         "FK_PurchaseItem_Purchase" => array(
                                                                         "Purchase" => "1" ,
                                                                         "PurchaseItem" => "*" ));

    
            $this->_Accessory = new DataServiceQuery('/'.'Accessory', $this);
            $this->_Console = new DataServiceQuery('/'.'Console', $this);
            $this->_Customer = new DataServiceQuery('/'.'Customer', $this);
            $this->_Game = new DataServiceQuery('/'.'Game', $this);
            $this->_Product = new DataServiceQuery('/'.'Product', $this);
            $this->_ProductType = new DataServiceQuery('/'.'ProductType', $this);
            $this->_Purchase = new DataServiceQuery('/'.'Purchase', $this);
            $this->_PurchaseItem = new DataServiceQuery('/'.'PurchaseItem', $this);
            $this->_Supplier = new DataServiceQuery('/'.'Supplier', $this);
            $this->_sysdiagrams = new DataServiceQuery('/'.'sysdiagrams', $this);

        }

    
        /**
         * Function returns DataServiceQuery reference for
         * the entityset Accessory
         * @return DataServiceQuery
         */
        public function Accessory()
        {
            $this->_Accessory->ClearAllOptions();
            return $this->_Accessory;
        }
    
        /**
         * Function returns DataServiceQuery reference for
         * the entityset Console
         * @return DataServiceQuery
         */
        public function Console()
        {
            $this->_Console->ClearAllOptions();
            return $this->_Console;
        }
    
        /**
         * Function returns DataServiceQuery reference for
         * the entityset Customer
         * @return DataServiceQuery
         */
        public function Customer()
        {
            $this->_Customer->ClearAllOptions();
            return $this->_Customer;
        }
    
        /**
         * Function returns DataServiceQuery reference for
         * the entityset Game
         * @return DataServiceQuery
         */
        public function Game()
        {
            $this->_Game->ClearAllOptions();
            return $this->_Game;
        }
    
        /**
         * Function returns DataServiceQuery reference for
         * the entityset Product
         * @return DataServiceQuery
         */
        public function Product()
        {
            $this->_Product->ClearAllOptions();
            return $this->_Product;
        }
    
        /**
         * Function returns DataServiceQuery reference for
         * the entityset ProductType
         * @return DataServiceQuery
         */
        public function ProductType()
        {
            $this->_ProductType->ClearAllOptions();
            return $this->_ProductType;
        }
    
        /**
         * Function returns DataServiceQuery reference for
         * the entityset Purchase
         * @return DataServiceQuery
         */
        public function Purchase()
        {
            $this->_Purchase->ClearAllOptions();
            return $this->_Purchase;
        }
    
        /**
         * Function returns DataServiceQuery reference for
         * the entityset PurchaseItem
         * @return DataServiceQuery
         */
        public function PurchaseItem()
        {
            $this->_PurchaseItem->ClearAllOptions();
            return $this->_PurchaseItem;
        }
    
        /**
         * Function returns DataServiceQuery reference for
         * the entityset Supplier
         * @return DataServiceQuery
         */
        public function Supplier()
        {
            $this->_Supplier->ClearAllOptions();
            return $this->_Supplier;
        }
    
        /**
         * Function returns DataServiceQuery reference for
         * the entityset sysdiagrams
         * @return DataServiceQuery
         */
        public function sysdiagrams()
        {
            $this->_sysdiagrams->ClearAllOptions();
            return $this->_sysdiagrams;
        }
    
       /**
        * Functions for adding object to the entityset/collection
        */
    
       /**
        * Add Accessory
        * @param Accessory $object
        */
      public function AddToAccessory($object)
        {
            return parent::AddObject('Accessory', $object);
        }
    
       /**
        * Add Console
        * @param Console $object
        */
      public function AddToConsole($object)
        {
            return parent::AddObject('Console', $object);
        }
    
       /**
        * Add Customer
        * @param Customer $object
        */
      public function AddToCustomer($object)
        {
            return parent::AddObject('Customer', $object);
        }
    
       /**
        * Add Game
        * @param Game $object
        */
      public function AddToGame($object)
        {
            return parent::AddObject('Game', $object);
        }
    
       /**
        * Add Product
        * @param Product $object
        */
      public function AddToProduct($object)
        {
            return parent::AddObject('Product', $object);
        }
    
       /**
        * Add ProductType
        * @param ProductType $object
        */
      public function AddToProductType($object)
        {
            return parent::AddObject('ProductType', $object);
        }
    
       /**
        * Add Purchase
        * @param Purchase $object
        */
      public function AddToPurchase($object)
        {
            return parent::AddObject('Purchase', $object);
        }
    
       /**
        * Add PurchaseItem
        * @param PurchaseItem $object
        */
      public function AddToPurchaseItem($object)
        {
            return parent::AddObject('PurchaseItem', $object);
        }
    
       /**
        * Add Supplier
        * @param Supplier $object
        */
      public function AddToSupplier($object)
        {
            return parent::AddObject('Supplier', $object);
        }
    
       /**
        * Add sysdiagrams
        * @param sysdiagrams $object
        */
      public function AddTosysdiagrams($object)
        {
            return parent::AddObject('sysdiagrams', $object);
        }
    

       /**
        * This function returns the entities.
        */
        public function getEntities()
        {
            return $this->_entities;
        }
    }
  
?>
  